perf: disable dts emit for workspace packages and enable zod compile - #41
perf: disable dts emit for workspace packages and enable zod compile#41mrboxs wants to merge 1 commit into
Conversation
Skip .d.ts generation in vp pack for api, auth, db, env, shared and server: all packages are private, exports resolve to src via devExports, and nothing consumes dist declarations. The oRPC Implementer type alone expanded to ~25k lines / 1.9 MB of .d.ts (~20s). Typechecking stays covered by vp check.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (10)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe change disables Vite declaration generation for the server and workspace packages. It also adds ChangesBuild and schema configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change makes affected private package builds transpile-only and enables compiled Zod parsers in selected schemas. Current validation indicates the build and typechecking contracts remain intact, with no remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why
Building
@altstack/apitook ~20s while every other workspace package built in 1–4s. Investigation showed 100% of that time was spent in.d.tsgeneration (rolldown-plugin-dts+ tsgo): the oRPCImplementertype carries the whole contract map, soprocedures.d.mtsalone expanded to ~25k lines / 1.07 MB (1.94 MB total), requiring ~65k module resolutions.Those declarations are never consumed: all packages are
private, everyexportsentry resolves tosrcviadevExports, nopublishConfigreferences any.d.mts, and Docker runtimes only ship.mjs+src.What changed
dts: falseinvite.config.tsforpackages/api,auth,db,env,shared, andapps/server(with a comment explaining why).packages/uiintentionally untouched — it has nobuildscript and is consumed purely fromsrc.import 'zod/compile'above the zod schemas inpackages/api/src/contracts/{altstack,health}.tsandpackages/shared/src/schemas/{project,role}.tsto enable JIT-compiled parsers at runtime.Measured results (
vp packper package)Verification
vp run -r build: success (remaining ~28s is the Nitro web build, 0 warnings/errors)vp check: all 130 files formatted, 88 files with no warnings/lint/type errors@altstack/apitests: 10/10 passedTrade-off
vp packno longer acts as an incidental typecheck (transpile-only, like esbuild). Type safety stays covered byvp check, whichreadyruns before build and tests.Summary by CodeRabbit